import Layout from '@/layout'

const sysRouter = {
  path: '/sys',
  component: Layout,
  name: 'sys_mgr',
  redirect: '/sys/dict/list',
  meta: { title: '系统管理', icon: 'ljm-tool', permissions: ['dict:sysDict:getByPage'] },
  children: [
    {
      path: 'dict',
      name: 'dict_mgr',
      component: () => import('@/views/sys/dict/index'),
      meta: { title: '字典信息', icon: 'ljm-dict', permissions: ['dict:sysDict:getByPage'] },
      redirect: 'list',
      children: [
        {
          path: 'list',
          name: 'dict_mgr_list',
          component: () => import('@/views/sys/dict/list'),
          meta: { title: '系统字典', permissions: ['dict:sysDict:getByPage'] }
        },
        {
          path: 'add',
          name: 'dict_mgr_add',
          component: () => import('@/views/sys/dict/add'),
          meta: { title: '新建字典', permissions: ['dict:sysDict:save'] },
          hidden: true
        },
        {
          path: 'edit',
          name: 'dict_mgr_edit',
          component: () => import('@/views/sys/dict/edit'),
          meta: { title: '修改字典', permissions: ['dict:sysDict:save'] },
          hidden: true
        },
        {
          path: 'view',
          name: 'dict_mgr_view',
          component: () => import('@/views/sys/dict/view'),
          meta: { title: '字典详情', permissions: ['dict:sysDict:getById'] },
          hidden: true
        },
        {
          path: 'item',
          name: 'dictitem_mgr',
          component: () => import('@/views/sys/dictItem/index'),
          meta: { title: '字典条目', permissions: ['dict:sysDict:sysDictItem:getByPage'] },
          redirect: 'list',
          hidden: true,
          children: [
            {
              path: 'list',
              name: 'dictitem_mgr_list',
              component: () => import('@/views/sys/dictItem/list'),
              meta: { title: '字典条目列表', permissions: ['dict:sysDict:sysDictItem:getByPage'] },
              hidden: true
            },
            {
              path: 'add',
              name: 'dictitem_mgr_add',
              component: () => import('@/views/sys/dictItem/add'),
              meta: { title: '新增字典条目', permissions: ['dict:sysDict:sysDictItem:save'] },
              hidden: true
            },
            {
              path: 'edit',
              name: 'dictitem_mgr_edit',
              component: () => import('@/views/sys/dictItem/edit'),
              meta: { title: '修改字典条目', permissions: ['dict:sysDict:sysDictItem:save'] },
              hidden: true
            },
            {
              path: 'view',
              name: 'dictitem_mgr_view',
              component: () => import('@/views/sys/dictItem/view'),
              meta: { title: '字典条目详情', permissions: ['dict:sysDict:sysDictItem:getById'] },
              hidden: true
            }
          ]
        }
      ]
    },
    {
      path: 'file',
      name: 'file_mgr',
      component: () => import('@/views/sys/file/index'),
      meta: { title: '文件管理', icon: 'ljm-file', permissions: ['file:record:getByPage'] },
      redirect: 'list',
      children: [
        {
          path: 'list',
          name: 'file_mgr_list',
          component: () => import('@/views/sys/file/list'),
          meta: { title: '文件列表', permissions: ['file:record:getByPage'] }
        }
      ]
    }
  ]
}

export default sysRouter
